﻿using System;
using System.Collections.Generic;
using System.Text;

namespace efcoredemo.Entity
{
    public class UserCompany
    {
        private UserCompany() { }
        /// <summary>
        /// 通过用户添加公司
        /// </summary>
        /// <param name="name"></param>
        public UserCompany(string name)
        {
            Name = name;
        }
        /// <summary>
        /// 单独为用户添加公司
        /// </summary>
        /// <param name="name"></param>
        /// <param name="userId"></param>
        public UserCompany(string name, long userId)
        {
            Name = name;
            UserId = userId;
        }
        /// <summary>
        /// 通过公司添加用户
        /// </summary>
        /// <param name="name"></param>
        /// <param name="user"></param>
        public UserCompany(string name, User user)
        {
            Name = name;
            User = user;
        }

        public UserCompany(long id,string name)
        {
            Id = id;
            Name = name;
        }

        public long Id { get; private set; }
        public string Name { get; private set; }
        public long UserId { get; private set; }
        public virtual User User { get; private set; }
    }

}
